<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
</body>
<script>
    /**
     * |或符号
     * @type {string}
     */
    let hd = "dakai.2@fgfdg"
    console.log(/uaa|@1/.test(hd))//false
    console.log(/uaa|@/.test(hd))//true

    let tel = "010-99999999"
    let tel1 = "010"
    let tel2 = "abc010-99999999"
    //-在正则表达式中有特殊意义，需要转义
    console.log(/(010|020)\-\d{7,8}/.test(tel)) //true
    console.log(/(010|020)\-\d{7,8}/.test(tel1)) //false
    console.log(/(010|020)\-\d{7,8}/.test(tel2)) //true
</script>
</html>
